<script setup lang='ts'>
const props = withDefaults(defineProps<IProps>(), {
    options: () => [],
})
const modelValue = defineModel<number>('modelValue', { required: true })

type IProps = {
    options?: {
        label: string
        value: number
    }[]
}

const { options } = toRefs(props)
</script>

<template>
    <el-form-item label-width="100px"
                  v-bind="$attrs"
    >
        <el-space class="w-full">
            <el-select v-model="modelValue"
                       placeholder="请选择"
            >
                <el-option v-for="{ label, value } in options"
                           :key="label"
                           :label="label"
                           :value="value"
                />
            </el-select>
        </el-space>
    </el-form-item>
</template>

<style lang="less" scoped>
:deep(.el-space .el-space__item:first-child) {
    width: 100px;
}
</style>
